/**
 * @description get param type
 */

function getType(param: any): string {
    const protoType = Object.prototype.toString.call(param);
    const spaceIndex = protoType.indexOf(' ');
    const type = protoType.slice(spaceIndex+1, -1).toLowerCase();
    return type;
}

// 功能测试
console.log(getType(123));
console.log(getType('afg'));
console.log(getType([]));
console.log(getType({}));
console.log(getType(new Set()));
console.log(getType(()=>{}));
console.log(getType(true));
console.log(getType(Symbol()));